Data Modeling
supOS boasts of its data modeling based on the concept of UNS (Unified Namespace). Through building data models according to its hierarchy, meanwhile automatically generating MQTT topics with the same name, data can be easily retrieved in real time.
Data models under UNS are empty structures with mock data connected through SourceFlow, follow the order displayed in the image to complete the data flow.

Building Data Model
Based on simple folder-file structure, you can define the data hierarchy to a tree map.
Factory/workshop/equipment/CNC will be used as an example to demenstrate the process of building data models.
- Log in to supOS, and then select UNS > Namespace.
- Under Model, click
to add a folder (namespace).
- Template: You can select a template to inherit attributes from it. See Building Template.
- Generate Template: Click
to add an attribute to the folder, at the same time you can select to generate a same template for future use.

Apply the same operation, add a folder workshop under Factory, and folder equipment under workshop.
- Select equipment, and then click
to add a file (data tag) under it.
- Data Type
Type | Description |
---|---|
Time Series | Receive real-time data and store it in TDEngine. |
Relational | Receive relational data and store it in a Postgres database. |
Calculation | Perform basic calculations on the added time series attributes. |
Aggregation | Aggregate the added data sources into JSON at a fixed frequency. |
- Attribute Generation Method
- Custom: Customize attributes.
- Template: Inherit attributes from the selected template.
- Reverse Generation: Use JSON text or connected databases to generate attributes with the same structure.
infoYou can connect databases under DevTools > DBConnect.

- Enter the information of the file, and then click Next.
- Select Persistance to enable history data storage, and then click Save.
By default, supOS generates a data flow with mock data in UNS > SourceFlow and a dashboard in System > Dashboards.

Generating Data Models through JSON
- Click
on the Model tab.
- Select the data type, and then write JSON text for the data model.
We will build a similar model for reference.
{
"Factory1": {
"workshop1": {
"equipment1": {
"CNC1": [
{
"actualRuntime1": 1380,
"plannedRuntime1": 1440
}
]
}
}
}
}

- Click Next, and select the model on the left side.
Click on each data level, you can change its information and add attributes on the right side.

- Click Save.
Building Template
- On the Namespace page, click Template.
- Click
, and then enter the information of the template.
Click Source to select added models and inherit their attributes.

- Click Save.